var FGOptions = {

    initUI : function () {
        var me = this;
        $( "#tabs" ).tabs();
        $('#btnInstall').button({
            create : function () {
                 $('#btnInstall').on('click',me.install.bind(me));    
            }
        });
    },

    install : function() {
        var me = this,
            chrome_search_engine = 'https://git.oschina.net/dong2590/freegg/raw/master/engine/chrome_search_engine.xml';
        window.external.AddSearchProvider(chrome_search_engine);
    }   
};

// $(function(){
//     FGOptions.initUI();
// });

window.onload = function() {
    document.getElementById('btnUpdate').addEventListener('click',function(event){
        Utils.getJSON({
            url : 'https://git.oschina.net/dong2590/freegg/raw/master/iplist.json',
            success : function(res) {
                var result = JSON.parse(res.responseText);
                if (result.success) {
                    localStorage.setItem('GG_SITES',GG_SITES.join('$,$'));
                }
            }
        });
    });
}